package app;
import org.orm.*;
public class Auth {
	
	public boolean  verificarUsuarioPasswd(String rut, String passwd ) throws PersistentException {
		PersistentTransaction t = auth.AuthPersistentManager.instance().getSession().beginTransaction();
		boolean out= false;
		try {
			auth.DAOFactory lDAOFactory = auth.DAOFactory.getDAOFactory();
			auth.dao.UsuarioDAO lauthUsuarioDAO = lDAOFactory.getUsuarioDAO();
			auth.Usuario lauthUsuario = lauthUsuarioDAO.loadUsuarioByQuery("rut='"+rut+"'", null);
			if (lauthUsuario.getPass().equals(passwd))
				out = true;
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		return out;
	}
}
